<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>Java连接MySQL基础教程(JDBC) | XY Blog</title><meta name="keywords" content="MySQL"><meta name="author" content="XY"><meta name="copyright" content="XY"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Java连接MySQL一般步骤">
<meta property="og:type" content="article">
<meta property="og:title" content="Java连接MySQL基础教程(JDBC)">
<meta property="og:url" content="http://example.com/2022/11/15/Java%E8%BF%9E%E6%8E%A5MySQL%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/index.html">
<meta property="og:site_name" content="XY Blog">
<meta property="og:description" content="Java连接MySQL一般步骤">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://example.com/img/Java_MySQL.jpg">
<meta property="article:published_time" content="2022-11-15T15:51:00.000Z">
<meta property="article:modified_time" content="2022-11-15T16:22:19.185Z">
<meta property="article:author" content="XY">
<meta property="article:tag" content="java">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://example.com/img/Java_MySQL.jpg"><link rel="shortcut icon" href="/img/liuxing.jpg"><link rel="canonical" href="http://example.com/2022/11/15/Java%E8%BF%9E%E6%8E%A5MySQL%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"简","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Java连接MySQL基础教程(JDBC)',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-11-16 00:22:19'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.2.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/liuxing.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">9</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">5</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">1</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">XY Blog</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标籤</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><main class="layout" id="content-inner"><div id="post"><div id="post-info"><h1 class="post-title">Java连接MySQL基础教程(JDBC)</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2022-11-15T15:51:00.000Z" title="发表于 2022-11-15 23:51:00">2022-11-15</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-11-15T16:22:19.185Z" title="更新于 2022-11-16 00:22:19">2022-11-16</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%8A%80%E6%9C%AF/">技术</a></span></div><div class="meta-secondline"></div></div></div><article class="post-content" id="article-container"><h3 id="引入依赖"><a href="#引入依赖" class="headerlink" title="引入依赖"></a>引入依赖</h3><p>如果你使用的是<code>IDEA</code>，只需要在<code>pom.xml</code>中添加依赖即可</p>
<figure class="highlight xml"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">dependency</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>mysql<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>mysql-connector-java<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line">      <span class="tag">&lt;<span class="name">version</span>&gt;</span>8.0.30<span class="tag">&lt;/<span class="name">version</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dependency</span>&gt;</span></span><br></pre></td></tr></table></figure>
<p>如果不是，那么你就需要自行下载依赖包，<a target="_blank" rel="noopener" href="http://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.0.8.zip">推荐这个网站下载并解压</a>。</p>
<h3 id="基本步骤"><a href="#基本步骤" class="headerlink" title="基本步骤"></a>基本步骤</h3><h4 id="1-加载驱动-jdbc4-0后会自动加载"><a href="#1-加载驱动-jdbc4-0后会自动加载" class="headerlink" title="1. 加载驱动(jdbc4.0后会自动加载)"></a>1. 加载驱动(jdbc4.0后会自动加载)</h4><p>你要让程序明白你需要连接什么数据库（<code>Access</code>？<code>Oracle</code>？<code>MySQL</code>！）</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">import java.sql.*;</span><br><span class="line"></span><br><span class="line">Class.forName(&quot;com.mysql.cj.jdbc.Driver&quot;);		// MySQL驱动</span><br></pre></td></tr></table></figure>
<h4 id="2-建立连接"><a href="#2-建立连接" class="headerlink" title="2.建立连接"></a>2.建立连接</h4><p>连接程序与MySQL数据库</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="type">Connection</span> <span class="variable">connection</span> <span class="operator">=</span> DriverManager.getConnection(DB_URL, name, passwd);</span><br><span class="line"></span><br><span class="line"><span class="comment">// DB_URL格式：&quot;jdbc:mysql://&quot; + ip + &quot;:&quot; + port + &quot;/&quot; + database</span></span><br></pre></td></tr></table></figure>
<h4 id="3-创建MySQL语句"><a href="#3-创建MySQL语句" class="headerlink" title="3.创建MySQL语句"></a>3.创建MySQL语句</h4><p>一般基础教程都会先使用<code>Statement</code>，但是正常连接都是<code>PreparedStatement</code>，这里只讲后者</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line">PreparedStatement pst;</span><br><span class="line">pst = connection.prepareStatement(sql);		</span><br><span class="line"></span><br><span class="line"><span class="comment">// sql格式：&quot;select * from student where id = ?&quot;</span></span><br><span class="line"><span class="comment">// &quot;delete from student where id = ?&quot;</span></span><br></pre></td></tr></table></figure>
<h4 id="4-处理语句"><a href="#4-处理语句" class="headerlink" title="4.处理语句"></a>4.处理语句</h4><p>使用<code>PreparedStatement</code>主要是因为其已经预编译了部分语句，只需要设置特定的参数并执行即可，相对来说更加方便快捷，而且更加安全</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">// 设置PreparedStatement中的参数，即预先备好的 &#x27;?&#x27;</span><br><span class="line">pst.setString(index, str);</span><br><span class="line">pst.setInt(index, num);</span><br></pre></td></tr></table></figure>
<h4 id="5-执行语句"><a href="#5-执行语句" class="headerlink" title="5.执行语句"></a>5.执行语句</h4><h5 id="增删改"><a href="#增删改" class="headerlink" title="增删改"></a>增删改</h5><p>这三个操作不会返回数据库中的信息，返回的是<code>SQL</code>影响的行数</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="type">int</span> <span class="variable">num</span> <span class="operator">=</span> pst.executeUpdate();</span><br><span class="line">System.out.println(<span class="string">&quot;影响了&quot;</span> + num + <span class="string">&quot;行&quot;</span>);</span><br></pre></td></tr></table></figure>
<h5 id="查"><a href="#查" class="headerlink" title="查"></a>查</h5><p>查询操作会返回<code>ResultSet</code>对象（可以视作一个表），当前行初始位置为<code>null</code>，使用<code>next</code>方法移动到下一行</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">// 遍历查询结果</span></span><br><span class="line"><span class="type">ResultSet</span> <span class="variable">res</span> <span class="operator">=</span> pst.executeQuery();</span><br><span class="line"><span class="keyword">while</span>(res.next())&#123;</span><br><span class="line">	<span class="type">String</span> <span class="variable">str</span> <span class="operator">=</span> res.getString(strIdx);</span><br><span class="line">    <span class="type">int</span> <span class="variable">num</span> <span class="operator">=</span> res.getInt(intIdx);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 释放资源</span></span><br><span class="line">res.close();</span><br></pre></td></tr></table></figure>
<h4 id="6-释放资源"><a href="#6-释放资源" class="headerlink" title="6.释放资源"></a>6.释放资源</h4><p>每一个对数据库的连接访问都是很宝贵的，所以我们执行完语句后一定要立即释放掉</p>
<figure class="highlight java"><table><tr><td class="code"><pre><span class="line">pst.close();</span><br><span class="line">connection.close();</span><br></pre></td></tr></table></figure>
<p>至此，一条<code>SQL</code>语句就执行完毕，我们就实现了对<code>MySQL</code>数据库的一次简单的访问。QWQ</p>
</article><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/java/">java</a></div><div class="post_share"><div class="social-share" data-image="/img/Java_MySQL.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/04/07/Oauth2+Jwt%E5%AE%9E%E7%8E%B0%E5%9F%BA%E7%A1%80%E7%9A%84SSO/"><img class="prev-cover" src="/img/sso.jfif" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Oauth2+Jwt实现基础的SSO</div></div></a></div><div class="next-post pull-right"><a href="/2022/11/07/Json+MySQL%E5%88%9D%E6%8E%A2/"><img class="next-cover" src="/img/json.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Json文件读取（Java）</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2022/11/07/Json+MySQL%E5%88%9D%E6%8E%A2/" title="Json文件读取（Java）"><img class="cover" src="/img/json.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-11-07</div><div class="title">Json文件读取（Java）</div></div></a></div><div><a href="/2023/04/07/Oauth2+Jwt%E5%AE%9E%E7%8E%B0%E5%9F%BA%E7%A1%80%E7%9A%84SSO/" title="Oauth2+Jwt实现基础的SSO"><img class="cover" src="/img/sso.jfif" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-04-07</div><div class="title">Oauth2+Jwt实现基础的SSO</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BC%95%E5%85%A5%E4%BE%9D%E8%B5%96"><span class="toc-number">1.</span> <span class="toc-text">引入依赖</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%9F%BA%E6%9C%AC%E6%AD%A5%E9%AA%A4"><span class="toc-number">2.</span> <span class="toc-text">基本步骤</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-%E5%8A%A0%E8%BD%BD%E9%A9%B1%E5%8A%A8-jdbc4-0%E5%90%8E%E4%BC%9A%E8%87%AA%E5%8A%A8%E5%8A%A0%E8%BD%BD"><span class="toc-number">2.1.</span> <span class="toc-text">1. 加载驱动(jdbc4.0后会自动加载)</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-%E5%BB%BA%E7%AB%8B%E8%BF%9E%E6%8E%A5"><span class="toc-number">2.2.</span> <span class="toc-text">2.建立连接</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3-%E5%88%9B%E5%BB%BAMySQL%E8%AF%AD%E5%8F%A5"><span class="toc-number">2.3.</span> <span class="toc-text">3.创建MySQL语句</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#4-%E5%A4%84%E7%90%86%E8%AF%AD%E5%8F%A5"><span class="toc-number">2.4.</span> <span class="toc-text">4.处理语句</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#5-%E6%89%A7%E8%A1%8C%E8%AF%AD%E5%8F%A5"><span class="toc-number">2.5.</span> <span class="toc-text">5.执行语句</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%A2%9E%E5%88%A0%E6%94%B9"><span class="toc-number">2.5.1.</span> <span class="toc-text">增删改</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%9F%A5"><span class="toc-number">2.5.2.</span> <span class="toc-text">查</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#6-%E9%87%8A%E6%94%BE%E8%B5%84%E6%BA%90"><span class="toc-number">2.6.</span> <span class="toc-text">6.释放资源</span></a></li></ol></li></ol></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2022 - 2023 By XY</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my blog! <a target="_blank" rel="noopener" href="https://beian.miit.gov.cn"><img class="icp-icon" src="https://img.alicdn.com/tfs/TB1..50QpXXXXX7XpXXXXXXXXXX-40-40.png"><span>蜀ICP备2022030939号</span></a> <a href="https://icp.gov.moe/?keyword=20220702" target="_blank">萌ICP备20220702号</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">简</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><div class="js-pjax"><script>(() => {
  const $mermaidWrap = document.querySelectorAll('#article-container .mermaid-wrap')
  if ($mermaidWrap.length) {
    window.runMermaid = () => {
      window.loadMermaid = true
      const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'

      Array.from($mermaidWrap).forEach((item, index) => {
        const mermaidSrc = item.firstElementChild
        const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
        const mermaidID = 'mermaid-' + index
        const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent
        mermaid.mermaidAPI.render(mermaidID, mermaidDefinition, (svgCode) => {
          mermaidSrc.insertAdjacentHTML('afterend', svgCode)
        })
      })
    }

    const loadMermaid = () => {
      window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
    }

    window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
  }
})()</script></div><script defer="defer" id="ribbon" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-ribbon.min.js" size="150" alpha="0.6" zIndex="-1" mobile="true" data-click="true"></script></div></body></html>